<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="common(links)">
    <link rel="stylesheet"  th:href="@{/css/bootstrap.min.css}" >
    <link rel="stylesheet"  th:href="@{/css/nav.css}" >
    <link rel="stylesheet"  th:href="@{/css/blog/index.css}" >
    <link rel="stylesheet"  th:href="@{/css/blog/common.css}" >
<!-- 引入每页的标题logo   -->
<!--    <link rel="icon"  th:href="@{/favicon.ico}"  >-->
<!--    <link rel="bookmark"  th:href="@{/favicon.ico}" >-->
</head>
<body>
<!-- 定义Js节点 -->
<div th:fragment="commonjs">
    <script th:src="@{/js/jquery-3.1.1.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
    <script th:src="@{/layer/layer.js}"></script>
    <script th:src="@{/js/blog/blog.js}"></script>
<!-- bootstrap提示所需js -->
    <script>
        $(function () { $("[data-toggle='tooltip']").tooltip(); });
    </script>
</div>
<!-- 顶部导航栏 -->
    <header th:fragment="navheader">
        <nav id="nav" class="nav navbar-default " role="navigation"  >
          <!--定义导航条宽高度-->
            <div class='container-fluid'>
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse"
                        data-target="#example-navbar-collapse">
                    <span class="sr-only">切换导航</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <!-- 放置Logo -->
                <a class='navbar-brand' th:href="@{/}"
                   data-toggle="tooltip" data-placement="bottom" title="当机会来临时,你已准备妥当!" >
                    <img th:src="@{/images/index/Logo.png}" style="height: 60px;" >
                </a>
            </div>
            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class='collapse navbar-collapse' id="example-navbar-collapse" >
                <ul class='nav navbar-nav'>
                    <li class="active"><a th:href="@{/}">首页</a></li>
                    <li><a href='#'>问答</a></li>
                    <li><a href='#'>专栏</a></li>
                    <li><a href='#'>资讯</a></li>
                    <li><a href='#'>课程</a></li>
                    <li><a href='#'>活动</a></li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <li><a onclick="navqiehuan()"> <span class="glyphicon glyphicon-tint"></span></a></li>
                    <li><a th:href="@{/essay/writing-blog}" ><span class="glyphicon glyphicon-book"></span> 写博客</a></li>
                    <li th:if="${session.user == null}"><a th:href="@{/navigation/register}"><span class="glyphicon glyphicon-user"></span> 注册</a></li>
                    <li th:if="${session.user == null}"><a th:href="@{/navigation/login}"><span class="glyphicon glyphicon-log-in"></span> 登录</a></li>
                    <li th:if="${session.user != null}">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <span th:text="${session.user.uname}" >张三</span>
                            <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu">
                            <li><a href="#">我的关注</a></li>
                            <li><a href="#">我的收藏</a></li>
                            <li><a th:href="@{/navigation/personinfo}">个人中心</a></li>
                            <li><a href="#">账号设置</a></li>
                            <li class="divider"></li>
                            <li><a th:href="@{/navigation/personblog}">我的博客</a></li>
                            <li><a th:href="@{/essay/admin-essay}">管理博客</a></li>
                            <li class="divider"></li>
                            <li><a href="#">帮助</a></li>
                            <li><a onclick="loginout()">退出</a></li>
                        </ul>
                    </li>
                </ul>
            </div><!-- /.navbar-collapse -->
          </div><!-- /.container-fluid -->
        </nav>
        <!-- 退出登录 -->
        <script>
            function loginout() {
                layer.msg('正在退出,请稍后!',{icon: 16,shade:0.01});
                $.get('/account/loginout',
                    {'num':0},
                    function (resultMag) {
                        if (resultMag.state == 200) {
                            layer.msg(resultMag.msg,{icon:6,time:1000,end: function () {
                                    window.location.reload();//刷新导航
                                }});
                        }
                    });
            }
        </script>
    </header>
<!-- 博客管理 左侧导航  -->
    <div class="left-navigation" th:fragment="adminBlog-left" >
        <ul style="padding-left: 0px;">
            <li style="margin:0 0 30px 0px"><a th:href="@{/essay/writing-blog}"><span class="glyphicon glyphicon-book"></span>&nbsp;创作博客</a></li>
            <li style="margin: 10px 0 10px  0 ;"><a th:href="@{/navigation/personblog}"><span class="glyphicon glyphicon-home"></span>&nbsp;我的首页</a></li>
            <li ><p class="hx7"></p></li>
            <li class="left-li"><a th:href="@{/essay/admin-essay(page=1,size=5)}" >文章管理</a></li>
            <li ><p class="hx7"></p></li>
            <li class="left-li"><a th:href="@{/comment/pl-admin}" >评论管理</a></li>
            <li ><p class="hx7"></p></li>
            <li class="left-li"><a th:href="@{/navigation/praise-admin}" >点赞管理</a></li>
            <li ><p class="hx7"></p></li>
            <li class="left-li"><a th:href="@{/special/classify-admin(page=1,size=5)}" >分类专栏</a></li>
            <li ><p class="hx7"></p></li>
            <li class="left-li"><a th:href="@{/navigation/set-blog}">博客设置</a></li>
            <li ><p class="hx7"></p></li>
            <li class="left-li"><a th:href="@{/navigation/data-detail}" >数据详情</a></li>
            <li ><p class="hx7"></p></li>
        </ul>
    </div>
<!--  yzm -->
<script th:fragment="yzmm">
    <!-- 日期时间转换字符串  -->
    Date.prototype.Format = function (fmt) {
        var o = {
            "M+": this.getMonth() + 1, //月份
            "d+": this.getDate(), //日
            "H+": this.getHours(), //小时
            "m+": this.getMinutes(), //分
            "s+": this.getSeconds(), //秒
            "q+": Math.floor((this.getMonth() + 3) / 3), //季度
            "S": this.getMilliseconds() //毫秒
        };
        if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
        for (var k in o)
            if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
        return fmt;
    }

    function getCode() {
        //    点击刷新
        $("#img").attr("src","/account/getcode?date="+new Date().Format("yyyy-MM-dd/HH:mm:ss"));
        return false;
    }
</script>
</body>
</html>